/**
 * Store for Pools
 */
Ext.define("Cps.store.Pools",
{
    extend: "Ext.data.Store",
	
    constructor: function (config)
    {
		if(config)
			this.initConfig(config);
		var f_data = [];
		this.callParent([
		{
			storeId: 'Pools',
			model: 'Cps.model.Pool',
			data: f_data
		}]);
		var Pools = this;
		Ext.Ajax.request({
			method: 'GET',
			url: Cps.Config.Api.getPool,
			success: function(data) {
				data = Ext.JSON.decode(data.responseText).data;
				data = data ? data.ttPool : null;
				data = data ? data.ttPoolRow : null;
				f_data.push({ PoolCode: '0', PoolName: Cps.Locale.Dashboard1.all});
				for(i = 0; i < data.length; i++) {
					f_data.push(data[i]);
				}
				Pools.loadData(f_data);
			},
			scope: this
		});
    },
});

		